﻿<Gui:XCaseGridBase
    x:Class="XCase.Gui.AssociationGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Gui="clr-namespace:XCase.Gui"
    ScrollViewer.HorizontalScrollBarVisibility="Auto"
    SizeChanged="AssociationGrid_SizeChanged"
    >
    <ScrollViewer  Name="scrollViewer" ScrollViewer.HorizontalScrollBarVisibility="Auto"
                          ScrollViewer.VerticalScrollBarVisibility="Auto">
        <StackPanel Margin="0,0,0,0">
            <Grid Name="grid" Margin="5,0,5,0" >
                <Grid.Resources>
                    <Gui:RenameAssociationConverter x:Key="renameAssociation"/>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="20"  />
                    <RowDefinition Height="Auto"  />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60" MaxWidth="60"/>
                    <ColumnDefinition MinWidth="62" />
                </Grid.ColumnDefinitions>

                <!-- Association name -->
                <Label Name="mainLabel" Grid.Row="0" Grid.ColumnSpan="2" Focusable="True">
                    Association
                </Label>
                <TextBox Grid.Row="1" Grid.Column="0" IsReadOnly="True" Focusable="False">
                    Name
                </TextBox>
                <TextBox  Grid.Row="1" Grid.Column="1" 
                      Name="associationNameBox" 
                      KeyDown="KeyPressed_Down"
                      KeyUp="KeyPressed_Up" 
                      HorizontalAlignment="Left"
                      SizeChanged="associationNameBox_SizeChanged"
                      Text="{Binding Path=Name, Converter={StaticResource renameAssociation}}" />
            </Grid>
            <!-- Ends -->
            <Gui:AssociationEndsGrid x:Name="ends" HorizontalAlignment="Left" />
        </StackPanel>
    </ScrollViewer>
</Gui:XCaseGridBase>